CCIT
coder
Home
Courses
Contact
CCITcoder
Contents
Introduction to Java
History of Java
Features
General Format
Datatypes
DataType and Operation
Datatypes
Operators
Program Input
Conditional statements
If statement
Nested if
Ladder if statement
Ternary Operator
Switch statement
Iterative statements
While loop
for loop
do while
Nested loops
Functions
Introduction and types of function
Function arguments
Function returning value
OOPs
OOPs
Object
Access Specifiers
Methods Returning Value
Nesting of methods
method Overloading
Constructor
Constructor Overloading
Immutablemmutable Objects
String
String
String Buffer
Static Data members
Static Data members
Static Methods
Class Math
Static Initialization Block
Inherintance
Inherintance
Method Overriding
calling base method
Constructors and Inheritance
Types of Inheritance
Single Inhertance
Multi-level Inheritance
Hierarchical Inheritance
Polymorphisam
super keyword
this keyword
final keyword
Abstract keyword
Polymorphism
Aggregation
Interfaces
Applets
Applets
Class Applet
Class Graphics
class Color
AWT
AWT
Class Frame
Class Button
Event Delegation Modal
Class TextField
Class TextArea
Class Label
Class Component
Class Container
Class Checkbox
Class List
Class Choice
Class FlowLayout
Class BorderLayout
Class GridLayout
Class CardLayout
Class Panel
Class Font
Menus
Mouse Events
Window Events
MultiThreading
MultiThreading
class therad
Interface Runnable
I/o
I/O
Class Reader/writer
Class Input/output Stream
Preprocessor Commands
Preprocessor Commands
Exception Handling
Exception Handling
Types of exceptions
throw
finally
User-defined Exceptions
Nested Exceptions
Collection FrameWork
Collection FrameWork
ArrayList
Vector
Stack
Linked List
Array Deque
Hash Set
Hash Map
Contents
Introduction to Java
History of Java
Features
General Format
Datatypes
DataType and Operation
Datatypes
Operators
Program Input
Conditional statements
If statement
Nested if
Ladder if statement
Ternary Operator
Switch statement
Iterative statements
While loop
for loop
do while
Nested loops
Functions
Introduction and types of function
Function arguments
Function returning value
OOPs
OOPs
Object
Access Specifiers
Methods Returning Value
Nesting of methods
method Overloading
Constructor
Constructor Overloading
Immutablemmutable Objects
String
String
String Buffer
Static Data members
Static Data members
Static Methods
Class Math
Static Initialization Block
Inherintance
Inherintance
Method Overriding
calling base method
Constructors and Inheritance
Types of Inheritance
Single Inhertance
Multi-level Inheritance
Hierarchical Inheritance
Polymorphisam
super keyword
this keyword
final keyword
Abstract keyword
Polymorphism
Aggregation
Interfaces
Applets
Applets
Class Applet
Class Graphics
class Color
AWT
AWT
Class Frame
Class Button
Event Delegation Modal
Class TextField
Class TextArea
Class Label
Class Component
Class Container
Class Checkbox
Class List
Class Choice
Class FlowLayout
Class BorderLayout
Class GridLayout
Class CardLayout
Class Panel
Class Font
Menus
Mouse Events
Window Events
MultiThreading
MultiThreading
class therad
Interface Runnable
I/o
I/O
Class Reader/writer
Class Input/output Stream
Preprocessor Commands
Preprocessor Commands
Exception Handling
Exception Handling
Types of exceptions
throw
finally
User-defined Exceptions
Nested Exceptions
Collection FrameWork
Collection FrameWork
ArrayList
Vector
Stack
Linked List
Array Deque
Hash Set
Hash Map
Topics
Menu
AWT-Abstract Window Toolkit
Class Component
This class is base class for all component classes such as Button, TextField, Checkbox, Label, List etc as well as Container classes.
Methods
void setBackground( Color c )
Sets background color of component.
For ex:
btn.setBackground(Color.yellow);
void setForeground( Color c )
Sets foreground color of component.
For ex:
btn.setForeground(Color.red);
void setFont( Font f )
Sets font of component.
For ex:
btn.setFont(fnt);
void setVisible( boolean b )
Shows or hides component.
For ex:
btn.setVisible(false);
void setEnabled( boolean b )
Enables or disables this component.
For ex:
btn.setEnabled(false);
void setLocation( int x ,int y )
Moves this component to a new location.
For ex:
btn.setLocation(100,50);
void setSize( int width , int height )
Resizes this component.
For ex:
btn.setSize(100,50);
void setBounds( int x , int y , int width , int height )
Moves and resizes this component.
For ex:
btn.setBounds(300,200,100,50);
void repaint()
Repaints this component.
For ex:
btn.repaint();
Color getForeground()
Gets the foreground color of component.
For ex:
Color c=btn.getForeground();
Color getBackground()
Gets the background color of component.
For ex:
Color c=btn.getBackground();
Dimension getSize()
Returns the size of component in Dimension object.
Dimension objects contains 2 public data members width and height.
For ex:
Dimension d=btn.getSize();
Graphics getGraphics()
returns a graphics type of Object for component.
This graphics object can be used to perform paint operations on the component.
For ex:
Graphics g=btn.getGraphics();
g.fillOval(10,10,30,20);
Previous topic
Class Label
Next topic
Class Container
Contents